<%@ include file="../header.jsp" %>
	<div id="content">
		<div>
	</div>
	<div>
	<div class="articlist">
			<table border="1" bgcolor="lightYellow" >
				<tr>
				<c:choose>
				<c:when test='${option != "nombre" }'>
				<th><a href="orderProducts?option=nombre&order=asc"> Nombre </a></th>
				</c:when>
				<c:when test='${option == "nombre" }'>
				<th><a href="orderProducts?option=nombre&order=${order}"> Nombre </a></th>
				</c:when>
				</c:choose>
				<c:choose>
				<c:when test='${option != "precio" }'>
				<th><a href="orderProducts?option=precio&order=asc"> Precio </a></th>
				</c:when>
				<c:when test='${option == "precio" }'>
				<th><a href="orderProducts?option=precio&order=${order}"> Precio </a></th>
				</c:when>
				</c:choose>
				<c:choose>
				<c:when test='${option != "fecha" }'>
				<th><a href="orderProducts?option=fecha&order=asc"> Fecha de publicacion </a></th>
				</c:when>
				<c:when test='${option == "fecha" }'>
				<th><a href="orderProducts?option=fecha&order=${order}"> Fecha de Publicacion </a></th>
				</c:when>
				</c:choose>
				</tr>
				<tr></tr>
			<c:forEach items="${productList}" var="product">
				<tr>
					<td>
					<span>
					<a href="<c:url value="viewProduct"><c:param name="id" value="${product.id}" /></c:url>">
						<c:out value="${product.name}" />
					</a>
					</span>
					</td>
					<td>
					<span>
						$ <c:out value="${product.price}" />
					</span>
					</td>
					<td>
					<span>
					<label>Fecha de publicacion: </label>
					<fmt:formatDate type="date" value="${product.release_date }"/>
					</span>
			</td>
			</tr>
			</c:forEach>
			</table>
		</div>
	</div>
	</div>
<%@ include file="../footer.jsp" %>